package com.lanou3g.dubbo.consumer;

import com.lanou3g.dubbo.api.IHello;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import javax.annotation.PostConstruct;
import java.io.IOException;

@SpringBootApplication
public class ConsumerApplication {

	@Reference(version = "1.0.0")
	private IHello helloService;

	@PostConstruct
	public void testInvokeService() {
		String msg = helloService.sayHello();
		System.out.println(msg);
	}

	public static void main(String[] args) throws IOException {
		SpringApplication.run(ConsumerApplication.class, args);
	}

}
